<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
   
</head>
<body>
    <div id="app"></div>
    <script src="vue.js"></script>
    <script>
        //组件3步骤 1.声明 2.注册 3使用
        var myHeader={
            template:`
            <div> i am header </div>
            `,
        }

        //global state ,have no need register
        Vue.component('myFooter',{
            template:`
            <div> i am foot </div>
            `
        })

        var myBody={
            template:`
            <div> i am body </div>
            `,
        }
        // var myFoot={
        //     template:`
        //     <div> i am foot </div>
        //     `
        // }

        new Vue({
            el:'#app',
            components:{
                myHeader,
                myBody,
            
            },
            template:`
            <div>
                <myHeader></myHeader>
                <myBody></myBody>
                <myFooter></myFooter>

            </div>
            `
        })
    </script>
</body>
</html>